package com.uchengwang.ui.base_ui.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

/**
 * Created by U城网 on 2017/2/27.
 */
/**
 * 这是一个有Title的界面
 *
 * @author zzh
 */

public class BaseWithTitleActivity extends BaseActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
        }
        public void setLeftTextView(String title, int color, int src, View.OnClickListener onClickListener) {
            titleBar.setLeftView(title, color,src, onClickListener);
        }

        public void setLeftListener(View.OnClickListener listener){
            titleBar.setLeftListener(listener);
        }

        public void setBackVisiable(boolean isVisiable) {
            titleBar.setLeftVisible(isVisiable);
        }


        public void setTitle(String title) {
            titleBar.setTitle(title, 0);
        }

        public void setTitle(String title, int color) {
            titleBar.setTitle(title, color);
        }
        public void setCenterImage(int src, String netUrl){
            titleBar.setCenterImage(this,src,netUrl);
        }


        public void setRightButton(int index,String text,int src, View.OnClickListener listener){
            titleBar.setBTIndexRes(index, text, src, listener);
        }

        public void setRightImage(int res, View.OnClickListener listener){
            titleBar.setImageRight(res, listener);
        }
        public void setRightImage(int width, int res, View.OnClickListener listener){
            titleBar.setImageRightWH(width, res, listener);
        }

        public void showOrHideDot(int visible){
            titleBar.showOrHideRightDot(visible);
        }

        public void setRightText(String text, View.OnClickListener listener){
            titleBar.setRightText(text, listener);
        }
        public TextView getRightText(){
            return titleBar.getRightTV();
        }

        /**
         * 标题栏设置背景颜色
         * */
        public void setTitleBgColor(int colorRes){
            titleBar.setTitleBarBackground(colorRes);
        }

        /**
         * 标题栏设置背景图
         * */
        public void setTitleBg(int resId){
            titleBar.setBg(resId);
        }


        /**
         * 底部分割线是否显示
         * */
        public void setBottomVisible(boolean visible){
            titleBar.visibleBottomLine(visible);
        }

        @Override
        protected void onDestroy() {
            super.onDestroy();
        }
}
